package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.GreenPointDao;
import cn.topevery.garden.entity.dto.GreenPointDTO;
import cn.topevery.garden.entity.po.GreenPoint;
import cn.topevery.garden.entity.po.GreenPoint;
import cn.topevery.garden.entity.query.GreenPointQuery;
import cn.topevery.garden.entity.vo.GreenPointVO;

import cn.topevery.garden.entity.vo.PointVO;
import hw.topevery.framework.db.entity.DataPager;
import hw.topevery.framework.db.base.BaseEntityDao;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;

/**
 * 样点表
 *
 * @author code-generate
 * @date 2023-11-17
 */
@Service
public class GreenPointLogic extends BaseLogic<GreenPoint> {
    @Autowired
    GreenPointDao greenPointDao;

    @Override
    public BaseEntityDao<GreenPoint, Integer> getDao() {
        return greenPointDao;
    }



    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<GreenPointVO> listPage(GreenPointQuery query) {
        return greenPointDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        greenPointDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param greenPoint 实体
     */
    public void saveOrUpdate(String userId, GreenPoint greenPoint){
        greenPointDao.saveOrUpdate(userId,greenPoint);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public GreenPoint getEntityByColumn(String key, String value) {
        return greenPointDao.getEntityByColumn(key, value);
    }

    public DataPager<GreenPointVO> getBySectionId(GreenPointQuery query) {
        return greenPointDao.getBySectionId(query);
    }
}
